home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_11_07
/
1107109a
< prev
next >
Wrap
Text File
|
1993-04-28
|
506b
|
25 lines
// copy4.cpp: Copy one file to another
#include <iostream.h>
#include <fstream.h> // Required for file streams
#include <stdlib.h>
main(int argc, char *argv[])
{
if (argc == 3)
{
ifstream inf(argv[1]);
ofstream outf(argv[2]);
if (inf && outf)
{
char c;
while (inf.get(c))
outf.put(c);
return EXIT_SUCCESS;
} // Streams destroyed by this point
}
return EXIT_FAILURE;
}